<!doctype html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>公告内容</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<include file="Public:iframe_header"/>
	<style type="text/css">
		*{
			font-size: 95%;
		}
		h4{
			margin: 20px;
			width: 80%;
			font-size: 93%;
		}
		table{
			width: 90%;
			text-align: center;
			margin: 30px auto;
			border-collapse: separate;
			border-spacing: 0;
			border: 2px #000;
			border: 1px solid #AAAAAA;
			border-radius: 10px;
		}
		table tr:first-child {
			border: 10px 0 0 10px;
			/*border-top-left-radius: 10px;
           border-top-right-radius: 10px;*/
			background-color: #0DC0D6;
		}
		table tr:first-child td:first-child {
			border-top-left-radius: 10px;
		}

		table tr:first-child td:last-child {
			border-top-right-radius: 10px;
		}
		table tr:last-child td:first-child {
			border-bottom-left-radius: 10px;
		}

		table tr:last-child td:last-child {
			border-bottom-right-radius: 10px;
		}

		p{
			text-indent:2em;
			text-align: left;
			width: 95%;
			margin: 5px auto;
			padding: 1px;
		}
		.d-fot{
			margin: 20px;
			text-align: left;

		}
		.but{
			text-align: center;
			margin: auto;
		}
		.but1,.but2{
			border-radius: 15px;
			margin: auto 30px;
		}
		.but1{
			background-color: orange;
		}
		.but2{
			background-color: #0DC0D6;
		}
		.content{
        	text-align: center;
        }
        .content *{
        	width: 95%;
        }
	</style>
</head>

<body>
<div class="mui-content" align="center" style="background-color: #fff;">
	<h4>{$data.title}</h4>
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>公告时间</td>
			<td>2018-01-23</td>
			<td>通知状态</td>
			<td>
				<if condition="($data.over_time gt time() or ($data.over_time eq 0))">
					公示中<else/>已过公示期
				</if>
			</td>
		</tr>
		<tr>
			<td>通知部门</td>
			<td>{$data.department}</td>
			<td>所属地区</td>
			<td>{$data.area}</td>
		</tr>
		<tr>
			<td>通知文号</td>
			<td>{$data.file_num}</td>
			<td>关键字</td>
			<td>{$keyword.keywords}</td>
		</tr>
		<tr>
			<td>通知时间</td>
			<td>
				<if condition="$data.over_time eq 0">
					无限时
					<else/>
					{$data.take_time|date="Y-m-d",###}至{$data.over_time|date="Y-m-d",###}
				</if>
			</td>
		</tr>
	</table>

	<div class="content">
		{$data.content}
	</div>
	<div class="d-fot">
		附件:<br />
		<a href="#">{$data.file_name}</a>
		<div class="but">
			<button class="but1"><a href="javascript:void(0)" onclick="view()">预览</a></button>
			<button class="but2"><a href="javascript:void(0)" onclick="down()">下载</a></button>
		</div>
	</div>
</div>
</body>
<script>
	function view(){
		$.ajax({
			url:"{:url('Notice/pdf_preview_cotinue')}",
			type:'POST',
			data:'',
			async:true,
			success:function(result){
				if(result.code == '0'){
					parent.tips(result.msg);
					return false;
				}else{
					index = layer.open({
					  type: 1
					  ,content: '<iframe style="width:100%;height:100%" src="{:url(\'Notice/pdf_preview\',array(\'id\'=>$id))}"></iframe>'
					  ,area:["100%","100%"]
					  ,style: 'position:fixed; bottom:0; left:0; width: 100%; height:100%; border:none;'
					});
					$(".layui-m-layercont").css({width:'100%',height:'100%'});
				}
			}
		});
	}

	function down(){
		$.ajax({
			url:"{:url('Notice/down_continue',array('id'=>$id))}",
			type:'POST',
			data:'',
			async:true,
			success:function(result){
				if(result.code == '0'){
					layer.open({
						content:result.msg,
						skin:'msg',
						time:2
					});
				}else{
					document.location.href="{:url('Notice/down_pdf',array('id'=>$id))}";
				}
			}

		});
	}
</script>
</html>